Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator II

How to create a straight table with flagged fields

This is a little difficult to explain, but I will try my best to articulate what I am looking for.  I am looking to filter my results in a straight table to determine if a person has made a transaction within the last 3 months and the last 6 months.  I have a field called Period that needs to be evaluated to determine that.  I've attached a sample QVW file that will make a lot more sense once you look at it.  There is also a straight table that contains the data that is summed for all Periods.  So, the current Period value is P9.  I also created a variable that has that in it.  If a person has Charges for Periods 1-9, then I do not wish to see them in the table.  If they have a charge in P1 and then no further charges, I would like to see a flag in the 3 month and 6 month field in the table. If they have charges in P1-P5, then I just want to see a flag in the 3 month field.  Here is a screenshot that might make more sense...

EmployeeLast Period3 Month6 MonthsTotal Charges
JOE SMITHP1xx$510.72
BOB JOHNSONP2xx$109.05
THOMAS DODDP3xx$645.88
ALEX RIVASP4x$713.64
CHRIS COLLINSP5x$1,000.42

Let me know if there s any additional information I can provide.

1 Solution

Accepted Solutions
sinanozdemir
Specialist III
Specialist III

Alright, take 2:

Capture.PNG

Hope this works

View solution in original post

15 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

It is still not quite clear to me so if you can clarify the below examples, it would be great:

For example, A G MCCLANAGHAN:

Capture.PNG

so what is the expected output for this person?

and another example,

Capture.PNG

what is the expected output for A L RIVERA-LOZADA?

and lastly:

Capture.PNG

what is the expected output for A G OBERMEYER?

The screenshot/excerpt you provided in the question doesn't correspond to your data set so I just need some more clarification.

Thanks.

cliff_clayman
Creator II
Creator II
Author

Sure...

EmployeeLast Period3 Months6 MonthsTotal Charges
A G MCCLANAGHANP5x$681.42

The last two would not display as they are within 3 months.  A L RIVERA-LOZADA had a transaction in P7 and A G OBERMEYER had a transaction in P9, so they are within 3 months.  I am looking to display users that are not making recent transactions.

sinanozdemir
Specialist III
Specialist III

Ok.

What is P1 P2, or P9? Are they months?

I guess this is where I am really struggling to understand. If A G MCCLANAGHAN has P1-P5, why are we showing "3 months" marked, but not "6 months"?

Thanks

cliff_clayman
Creator II
Creator II
Author

Yes, they are months.  So, if P9 is the current month and P5 was the last month a transaction occurred, then that person hasn't made a purchase within the last 3 months, but he has in the last 6 months.

sinanozdemir
Specialist III
Specialist III

Ok.

Thanks, let me take a stab at it.

qliksus
Specialist II
Specialist II

Hi ,

Maybe something like this

3Months : sum({<[PCard Full Name]=E({<Period={"=right(Period,1)>5"}>})>} TOTAL<[PCard Full Name]> [PCard Charge Amount] )  *

PurgeChar(Period=MaxString({<[PCard Full Name]=E({<Period={"=right(Period,1)>5"}>})>} total<[PCard Full Name]> Period),'-')

6 Months: sum({<[PCard Full Name]={"=Period=maxstring({<Period={'P1'}>}Period) "}>} TOTAL<[PCard Full Name]> [PCard Charge Amount] )

cliff_clayman
Creator II
Creator II
Author

This is very close to what I was looking for.  However, I just wanted to see an 'x' in the 3 mon and 6 mon columns and a total $ column after that.

cliff_clayman
Creator II
Creator II
Author

Any luck?

sinanozdemir
Specialist III
Specialist III

Hi Cliff,

Let me know if this is what you are looking for:

Capture.PNG