Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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

1 Solution

Accepted Solutions
Highlighted
Contributor III
Contributor III

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
Highlighted

can you provide some sample data with expected output.

Regards,
Prashant sangle
Great dreamer's dreams never fulfilled, they are always transcended.
Highlighted
Contributor III
Contributor III

Hi Prashant, 

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

 

Thanks,

David

Highlighted
Contributor III
Contributor III

example data..

Highlighted

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.
Highlighted
Contributor III
Contributor III

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

Highlighted
Contributor III
Contributor III

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

Highlighted
Partner
Partner

Hi Dave,

Please attache sample data. You can anonymous the data.

 

 

Highlighted
Contributor III
Contributor III

Hi Gabriel,

hows this?

Highlighted
Partner
Partner

Hi Dave,

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