Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

connecting different fields frim model via set analysis

hello everyone

I am facing an trouble with set analysis.

I have 2 not related tables: First includes only one column with dates, second have 3 column: Date, ID, amount.

every ID have 1+ dates with different amounts. Sure for each id we can calculate the min(date) and sum(amount)

what I need to do is to create a table chart with one dimension (date from 1 table) and one expression:if the date in dimention is equal to min(date) for some id from second table, we add the sum(amount) at this row (the whole amount for the whole period)

if needed, tomorrow I can provide a sample app with some data

thanks a lot in advance

alexandra

4 Replies
petter
Partner - Champion III
Partner - Champion III

2015-03-18.PNG

If I understood you correctly it could be solved with and IF or as you requested with a Set Expression too as

shown in my sample application above and attached as a QVW.

Good luck for tomorrow!

Not applicable
Author

Hi Petter!

This is close!

But what i meant, is this:

if using your sample (btw, thanks for that),

i need to get a table with dimention "SelectDate" and expression which will summarize "value" for the "ID" that have this date and min("Date")

so using your numbers I will have a table with 2 rows, like that

SelectDate  Sum(Value)

1/5/2015      101699 // 61552 + 40147 as sum(Value) for ID A, B

1/7/2015      113465 // 30487 + 82978 as sum(Value) for ID C, D

Not applicable
Author

Sure it doesn't really matter what to use: if() or {}

I was trying to do something like if(SelectDate = aggr(min(Date), ID), aggr(sum(Value), ID)) ..

sunny_talwar

Haven't looked at the post and the responses in detail, but one quick note. I think (I am not 100% sure and experts can correct me if I am wrong) you cannot compare a matrix to a single value (SelectDate = Aggr(Min(Date), ID)), but you can certainly compare a value to another value (SelectDate =Min/Max/Avg/Sum(Aggr(Min(Date), ID))).

Not sure if this will still solve what you are trying to do, but just wanted to let you know.

HTH

Best,

S