Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

A few questions...Load Script, Sum similar transactions.

Hi guys, i am really really new to Qlikview and have encountered some problems which i hope you guys can help me with. Been searching around for answer and trying but doesn't really work.

So an example of my data are as follow:

Transaction NoCustomer IDProduct CodeTransYearTransMonthPrice
000011AA120141100
000022AA220142150
00003

1

AA520142300
000042AA120142600
000052AA220143200
000061AA120143300
000071AA22014388

These are just first few of my data, there are thousands of transactions.

Questions:

1) When i load my script, i tried, date(makedate(TransYear,TransMonth),'MM-YYYY') as TransDate,

   However, the product that appeared as Transdate does not match TransYear and Transmonth of that particular Customer/Transaction.

   For Example, if i open a straight table with all the following data above, the TransDate would be, say for transaction 00001, 05-2015 and

   not 01-2014 as i hoped for. But when i input that formula as expression, it works perfectly fine.

2) I want to get sum purchased by each customer and also by product code. So in expression i would put

sum({<Customer ID,TransMonth>}Price) under the column, SpentMonth, and this would work fine. But after that, i also would like to perform another operation, by summing the SpentMonth for only month 1 and 2, which i cannot do since SpentMonth is not actually a field.

So as i have searched for answers around this forum, a method of solving this would be to perform the SpentMonth in the load script.

But i have absolutely no idea how since set analysis doesnt work in load script part.

It would really be awesome, if someone could kindly shine some light on this.

I sincerely thank you for taking the time to read and reply to this question.

Thank you

15 Replies
effinty2112
Master
Master

Hi Lance,

I looks like a pivot table would give you what you need:

Customer ID Product Code TransYear TransMonth Sum(Price)
1AA120141100
3300
AA22014388
AA520142300
2AA120142600
AA220142150
3200

You can add subtotals (partial sums) to any or all of the dimensions:

Customer ID Product Code TransYear TransMonth Sum(Price)
1AA120141100
3300
Total 400
Total 400
AA22014388
Total 88
Total 88
AA520142300
Total 300
Total 300
Total 788
2AA120142600
Total 600
Total 600
AA220142150
3200
Total 350
Total 350
Total 950
Total 1738
Not applicable
Author

Hi there, like you mentioned i can add subtotal right, but what if i dont want to sum all of them up?

For example, the table you attached,

Customer IDProduct CodeTransYearTransMonthSum(Price)
1AA120141100
3300
4200
AA22014388
AA520142300
2AA120142600
AA220142150
3200

I added another row to month 4 as you cans see the one without borders.

What if now i just want to sum month 3 and 4 together?

And then later i want it to be divided by 2 to show a ratio?

Thanks

Not applicable
Author

Hi there, i cant open the file, mine is personal edition, it is saying i need to change my user key or smth.

Not applicable
Author

Transaction NoProduct CodeTransYearTransMonthPrice
00001AA120141100
00002AA220142150
00003AA120143300
00004AA120144600
00005AA220145200
00006AA120147300
00007AA220148200
00008AA22015188
00009AA22015288
000010AA22015388
000011AA22015588
000012AA22015788
000013AA22015888
000014AA22015988

Okay here is as precise as it gets to what i want to do.

My end goal is a ratio.

So now we are at the end of 2015.

i want a Table that says:

Date             ProductCode     Ratio

Nov-2015        AA1                sum({<TransYear='2015',4<=TransMonth<=8>}Price)/sum({<TransYear='2014',4<=TransMonth<=8>}Price)

then will be

OCT-2015   AA1 ................................ and so on

Before i can do this sum, i already have sum of sales broken down by product code and by Month and year as shown

in this pivot table

Customer IDProduct CodeTransYearTransMonthSum(Price)
1AA120141100
3300
4200
AA22014388
AA520142300
2AA120142600
AA220142150
3200

*This is not the complete one* its just to say i have it broken down by year month and product code.

Not applicable
Author

Hi, my problem with real data set

Tricky question (With data and qlikview sheet attached)

Hope you can help

Thank you!

Not applicable
Author

Tricky question (With data and qlikview sheet attached)

My problem with real data set. (Excel output and qlikview summary)

Hope you guys can help.

Thank you