Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

How to account the sum when the id is not digital such as A001?

Hi,All. I hava a question about  How to account the sum when the id is not digital such as A001? Thanks!

1 Reply
MVP
MVP

Re: How to account the sum when the id is not digital such as A001?

Hi,

To solve this easily we need to get the addition flag field in script like below

LOAD

*,

If(IsNum(AccountNum), 0, 1) AS NonDigitAccount

FROM DataSource;

Now in expression you can directly use the below expression

=Sum({<NonDigitAccount={1}>} MeasureName)

If you don't want to change the script then you can try below expression

=Sum(Aggr(If(Not IsNum(AccountNum), MeasureName), AccountNum))  // The performance of this expression is not better when compared to the previous one.

** Note: Replace AccountNum and MeasureName with your actual field names.

Hope this helps you.

Regards,

Jagan.

Community Browser