Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Davidoff
Contributor III
Contributor III

show this years and last years figures on same line in table

Hi all,

I am displaying sales, profit etc in columns of a table and grouping the rows by Season. I am required to show the values for the previous year in the same row, but different columns.

Problem is, the previous year data shows in a different Season group, because I am looking at the previous years data. 

Season Group expression:

=AGGR(ONLY({$<F_Year_Week={"$(vSelectedYears)"}, WK={"$(vSelectedWeeks)"}>} StockSeason), StockSeason)

Example of one of previous years column expression:

Sum({$<SalesType={'Sale'}, FP_MD={'FP'}, F_Year_Week ={"$(vPrevSelectedYear)"}, WK={"$(vSelectedWeeks)"}>} Price)

All data selection is controlled by a date island and selections on screen are stored in the vSelectedYears & vSelectedWeeks variables. vPrevSelectedYear is derived from vSelectedYears.

App works fine, but shows the previous year info in a different season group.

 

Your expertise and any assistance is much appreciated.

David

Labels (2)
1 Solution

Accepted Solutions
Davidoff
Contributor III
Contributor III
Author

So I have had to give in and load the complete Sales dataset a second time to try and resolve the issue.

This does feel like an inelegant solution given Qlik's power. I had hoped there would be some set expression magic I could use here. Smiley Frustrated

 

View solution in original post

17 Replies
PrashantSangle

can you provide some sample data with expected output.

Regards,
Prashant sangle
Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Davidoff
Contributor III
Contributor III
Author

Hi Prashant, 

thanks for your reply. Does this help (attached)?

 

Thanks,

David

Davidoff
Contributor III
Contributor III
Author

example data..

PrashantSangle

all fields are coming from single table or multiple table.
If it is coming from single table then move your logic in script.

Regards,
Prashant Sangle
Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Davidoff
Contributor III
Contributor III
Author

Multiple tables.

I don't think i could move the logic into the load script; it needs to be dynamic, depending on what date range user selects. plus there are additional columns for stock, coming from another table. And the date island table of course.

 

Thanks,

David

Davidoff
Contributor III
Contributor III
Author

guys / gals,

am i wrong here? Can the expressions be put in the load script when the date ranges are selected in the UI by the user? And these ranges select records in date island?

Happy to accept I'm being thick here 🙂

Thanks.

David

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi Dave,

Please attache sample data. You can anonymous the data.

 

 

Davidoff
Contributor III
Contributor III
Author

Hi Gabriel,

hows this?

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi Dave,

Your filters in the expression has to be same except for vSelectedYears & vPrevSelectedYear. Try that and let me know