Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get this expression on Script??

Hi everyone,


How can I get this expression "LOTES" on the script:

count(distinct(aggr(Nro.Lote,Nro.Mat,Nro.Lote,Período)))

So then I cant get this Expression on the script too:

if ([Lotes]<=7,([Lotes]/1)*([AhorroHsComp]), if ([Lotes]>7 ,([Lotes]/4)*(AhorroHsComp)))

4 Replies
Clever_Anjos
Employee
Employee

LOAD

count(distinct Nro.Lote)

from yourqvd

group by Nro.Mat,Nro.Lote,Período;

LOAD

if ([Lotes]<=7,([Lotes]/1)*([AhorroHsComp]), if ([Lotes]>7 ,([Lotes]/4)*(AhorroHsComp))) as newfield

from yourqvd;

Not applicable
Author

Clever... does not work your soolution.

its returns '1'

I got this in a graph:

  The column Lotes is:

   count(distinct(aggr(Nro.Lote,Nro.Mat,Nro.Lote,Período)))

 

     I need to have this values already on the script!

rbecher
MVP
MVP

Please upload sample data.

Astrato.io Head of R&D
Not applicable
Author


try this,

aggr(count(distinct(Nro.Lote,Nro.Mat,Nro.Lote,Período)))