This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function JSONToCSVConvertor(JSONData, ReportTitle, ShowLabel, appendString) { | |
//If JSONData is not an object then JSON.parse will parse the JSON string in an Object | |
var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; | |
var CSV = ''; | |
//This condition will generate the Label/Header | |
if (ShowLabel) { | |
var row = ""; | |
//This loop will extract the label from 1st index of on array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://community.qlik.com/t5/QlikView-App-Development/number-of-17-digits/m-p/511285 | |
/* | |
Henric_Cronström | |
Employee | |
Henric_Cronström | |
Employee 2013-09-12 01:44 PM | |
Re: number of 17 digits | |
As Gysbert says, such a large number cannot be displayed as an integer. The 64-bit IEEE float can only show 14 digits. Instead, you should try | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fake_data_index = pd.MultiIndex.from_product([ | |
[ | |
'nate', | |
'jess' | |
], pd.date_range('2019-01-01', '2019-12-31') | |
], names=('who', 'date')) | |
fake_df = pd.DataFrame({ | |
'increasing': np.arange(len(fake_data)), | |
'random': np.random.rand(len(fake_data)) | |
}, index=fake_data_index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create a new field 'datetime', which converts strings to a datetime object | |
# datetime object will make our x-axis look good, showing appropriate labels like "Feb 2018" etc... | |
pyber_data_df['datetime'] = pd.to_datetime(pyber_data_df['date']) | |
# a datetime object *also* allows us to access the date part (2019-01-04) , ignoring the time-of-date part (05:39:20) | |
#Create another new field 'datedate' to store it | |
pyber_data_df['datedate'] = pyber_data_df['datetime'].dt.floor('d') | |
avg_fare_by_type_date = (pyber_data_df | |
#group by multiple fields by passing a list of those fields ; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nate, I am working on finding the primary position as we talked about. I have queried the db and summed each of the positions for a given player, but have hit a roadblock with finding the max and making that the primary position. I thought of using a CASE statement, but I would have to have a variable for the current max that updates as it looks at each position. I can do that in python, but I am not sure how to do that in sql. Thanks. I will paste my code below. | |
SELECT | |
playerID, | |
sum(G_all) Total_Games, | |
sum(GS) as Games_Started, | |
sum(G_p) as Games_Pitched, | |
sum(G_c) as Games_Catcher, | |
sum(G_1b) as Games_First_Base, | |
sum(G_2b) as Games_Second_Base, | |
sum(G_3b) as Games_Third_Base, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(******************************************************************************) | |
(* QlikView Expression Syntax *) | |
(******************************************************************************) | |
(* An extended subset of the script syntax file *) | |
(* *) | |
(* Things like function, field, macro and bookmark names are added at runtime *) | |
(* *) | |
(******************************************************************************) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET l1 = SUM(1); | |
SET l2 = COUNT($(l1)); | |
SET l3 = AVG($(l2)); | |
TRACE $(l3); // traces "AVG(COUNT(SUM(1))", ok... | |
LET ll1 = 'SUM(1)'; |