Qlik Community

Qlik Sense App Development

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

sirpod90
New Contributor III

Qlik (Sense) is not using dimensions for calculation

Hello everybody,

I am running at the moment in really weird problem and can not come up with any conclusions.

My Data looks like that:

Container-NameAction-DateStep-Name
Container1201.01.2016StepName-1
Container1202.01.2016StepName-2
Container1203.01.2016StepName-3
Container1204.01.2016StepName-1-V
Container4301.01.2016StepName-A
Container4301.01.2016StepName-B

I want to have table with the max step name the container past in time

So my result should look like that:

Container-NameAction-DateStep-Name
Container1204.01.2016StepName-1-V
Container4301.01.2016StepName-B


I set up a table with Container-Name as dimension and AGGR(max(Action-Date), Container-Name) as second dimension. If I now add the fact MaxString(Step-Name) the result looks for max string in all containers and not with the maximum date.


So my result looks like that:

Container-NameAction-DateStep-Name
Container1204.01.2016StepName-3
Container4301.01.2016StepName-B


It seams like the fact column would ignore the two dimensions before hand?

Why?? Do I have a wrong understanding of dimensions and facts?

When I tried to solve the problem with set analysis and only the container as dimension:

maxstring({$<Action-Date= {'&(=max(Action-Date))'}>}StepName)

My result where right but just for one Container, so Qlik took the max-Date from all dates, ignoring the dimension again.

Container-NameStep-Name
Container12
StepName-1-V
Container43-

I also tried to combine the set analysis with AGGR but the result is still wrong.

Is there something I really miss or does Qlik have a problem?

I am thank full for any help.

Regards!

1 Solution

Accepted Solutions

Re: Qlik (Sense) is not using dimensions for calculation

May be this:

Dimension

Container_Name

Expression

Date(Max(Action-Date))

FirstedSortedValue(Step_Name, -(Action-Date + (ID/1E10)))

10 Replies

Re: Qlik (Sense) is not using dimensions for calculation

Try using 1 dimension and 2 expressions:

Dimension

Container_Name

Expression

Date(Max(Action-Date))

FirstedSortedValue(Step_Name, -Action-Date)

Update: Also checkout how FirstSortedValue() function work

Value Associated with Min/Max Value of Another Field (Front End Solution)

sirpod90
New Contributor III

Re: Qlik (Sense) is not using dimensions for calculation

This works if the container passed one Step-Name but if not the result is empty even so the date is unique

Re: Qlik (Sense) is not using dimensions for calculation

You can have multiple Step_Names for each date and container?

sirpod90
New Contributor III

Re: Qlik (Sense) is not using dimensions for calculation

Yeah I have multiple rows, that is the point i didn't realized!

It is possible to get the first sorted value ordered by 2 parameters, or do I have to use a set analysis?

Re: Qlik (Sense) is not using dimensions for calculation

Would you want to show all the steps for the highest date within a container or pick one of the steps from the list? If it is the later, how do you plan to pick one? MaxString(Step Name)?

sirpod90
New Contributor III

Re: Qlik (Sense) is not using dimensions for calculation

Container-NameAction-DateStep-NameID
Container1201.01.2016StepName-11
Container1202.01.2016StepName-22
Container1203.01.2016StepName-33
Container1204.01.2016StepName-1-V8
Container4301.01.2016StepName-A05
Container4301.01.2016StepName-B06
Container1205.01.2016StepName-1-C4
Container1205.01.2016StepName-1-D5

I want to show one container step with the highest date and id. But the id is not in the right order, it is just relevant if i have more steps in the same time.

So my results should look like that:

Container-NameAction-DateStep-Name
Container4301.01.2016StepName-B
Container1205.01.2016StepName-1-D

Re: Qlik (Sense) is not using dimensions for calculation

May be this:

Dimension

Container_Name

Expression

Date(Max(Action-Date))

FirstedSortedValue(Step_Name, -(Action-Date + (ID/1E10)))

sirpod90
New Contributor III

Re: Qlik (Sense) is not using dimensions for calculation

Thank You.

Great and fast response

Digvijay_Singh
Honored Contributor III

Re: Qlik (Sense) is not using dimensions for calculation

Hi Sunny,

Could you pl help to understand the 1E10 divisor, didn't get that. Thanks in advance.

Digvijay,

Community Browser